package com.hnevc.xiaoming.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.hnevc.xiaoming.R;
import com.hnevc.xiaoming.adapter.MyWxAdapter;
import com.hnevc.xiaoming.bean.WxBean;

import java.util.ArrayList;
import java.util.List;

public class Fragment1 extends Fragment {

    private View view;
    private ListView listView1;
    private List<WxBean> list;
    private MyWxAdapter adapter;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment1_layout,container,false);
        initView();
        initData();
        initEvent();
        return view;
    }

    private void initEvent() {


    }

    private void initData() {


    }

    private void initView() {
        listView1 = view.findViewById(R.id.listView_1);
        list = new ArrayList<>();
        list.add(new WxBean(1,"1号跑龙套","a"));
        list.add(new WxBean(2,"2号跑龙套","b"));
        list.add(new WxBean(3,"3号跑龙套","c"));
        list.add(new WxBean(4,"4号跑龙套","d"));
        list.add(new WxBean(5,"5号跑龙套","e"));
        list.add(new WxBean(6,"6号跑龙套","f"));
        list.add(new WxBean(7,"7号跑龙套","g"));
        list.add(new WxBean(8,"8号跑龙套","k"));
        list.add(new WxBean(9,"9号跑龙套","l"));
        list.add(new WxBean(10,"10号跑龙套","n"));
        list.add(new WxBean(11,"11号跑龙套","q"));
        list.add(new WxBean(12,"12号跑龙套","v"));
        list.add(new WxBean(13,"13号跑龙套","w"));
        list.add(new WxBean(14,"14号跑龙套","j"));
        adapter = new MyWxAdapter(list,getContext());
        listView1.setAdapter(adapter);

    }
}
